/**
 * Created by henian.xu on 2017/7/19.
 *
 */

import * as types from './types';
import LocalStorage from '@/utils/localStorage';

import Api from '@/api';

export default {
    [types.USER_INFO]: (() => {
        const userInfo = LocalStorage.get(types.USER_INFO) ||
            {
                account: '',
                fullName: '',
                token: '',
                userId: null,
            };
        Api.auth(userInfo.token);
        return userInfo;
    })(),
};
